import Global from "../Global";
import Http from "../net/http/Http";


export  default abstract class PlatformBase {
    //请求配置数据
    public requestConfig(callback: any) {
        Http.get(Global.clientConfigUrl+"?clent="+Global.version, function(param){
            callback(param);
        }.bind(this));
    }

    /**
     * 检查更新
     */
     public check(callback: any): void {
        callback();
    }
    
    /**
     * 登录
     */
    public login(callback: any): void {
        callback();
    }
    /**
     * 分享
     * @param callback 分享回调 返回是否成功
     */
    public share(callback: (success: boolean) => void, param: any = null): void {
        callback(true);
    }
    /**
     * 看广告
     * @param callback 回调 返回是否成功
     */
    public watchAd(callback: (success: boolean) => void, adID: string = "", type: number = 0): void {
        callback(true);
    }
    /**
     * 广告优先于分享
     * @param callback 回调 返回是否成功
     */
    public adShare(callback: (success: boolean) => void): void {
        callback(true);
    }

    /**
     * 支付
     * @param callback 回调 返回是否成功
     */
     public pay(goodId: number, callback: (success: boolean,customId:number) => void): void {
        callback(true,0);
    }

    public abstract name(): string

}